package com.itheima.service.impl;

import com.itheima.dao.RoleMapper;
import com.itheima.pojo.Role;
import com.itheima.service.RoleService;
import com.itheima.utils.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * Create By Awen on 2021/8/23
 *
 * @author Awen
 */
public class RoleServiceImpl implements RoleService {

    @Override
    public List<Role> queryRoleList() {
        SqlSession session = SqlSessionUtil.getSqlSession();
        RoleMapper mapper = session.getMapper(RoleMapper.class);
        List<Role> list = mapper.queryRoleList();
        session.close();
        return list;
    }
}
